/**
 * Framework for batch testing user profile models
 * Final project by Sergey Nepomnyachiy and Julia Polchin
 * Supervisor: Tsvi Kuflik
 *
 */
package core;

import java.util.Collection;

import core.environment.Singleton;
import core.environment.fVector;

/**
 * A singleton class encapsulating all the predicted, observed data of a user
 * @author Sergey and Julia
 *
 */
@Singleton
public class UserObservedPredictedHolder {
	/**
	 * Predicted Vector
	 */
	private Collection<Object> PredictedV;
	/**
	 * Observed Vector
	 */
	private Collection<Object> ObservedV;
	/**
	 * A single instance of this class
	 */
	private static UserObservedPredictedHolder instance = new UserObservedPredictedHolder();
	
	private UserObservedPredictedHolder() {
		this.PredictedV = new fVector();
		this.ObservedV = new fVector();
	}
	
	/**
	 * Standard singleton method
	 * @return single instance of the class 
	 */
	public static UserObservedPredictedHolder getInstance() {
		return instance;
	}
	
	/**
	 * Add predicted value
	 * @param r single predicted value
	 */
	public void addPredicted(Object r) {
		this.PredictedV.add(r);
	}
	
	/**
	 * Add observed value
	 * @param l single observed value
	 */
	public void addObserved(Object l) {
		this.ObservedV.add(l);
	}
	
	/**
	 * Getter for the predicted
	 * @return  reference to storage of predicted data
	 */
	public Collection<Object> getPredicted() {
		return this.PredictedV;
	}
	
	/**
	 * Getter for the observed
	 * @return  reference to storage of observed data
	 */
	public Collection<Object> getObserved() {
		return this.ObservedV;
	}

	/**
	 * Clear all storage of observed
	 */
	public void clearObserved() {
		this.ObservedV.clear();
	}

	/**
	 * Clear all storage of predicted
	 */
	public void clearPredicted() {
		this.PredictedV.clear();
	}

}
